<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php JHTML::_('behavior.tooltip'); ?>
<?php
	// Set toolbar items for the page
	$edit		= JRequest::getVar('edit',true);
	$text = !$edit ? JText::_( 'New' ) : JText::_( 'Edit' );
	JToolBarHelper::title(   JText::_( strtoupper('Shop_category') ).': <small><small>[ ' . $text.' ]</small></small>' );
	JToolBarHelper::save();
	if (!$edit)  {
		JToolBarHelper::cancel();
	} else {
		// for existing items the button is renamed `close`
		JToolBarHelper::cancel( 'cancel', 'Close' );
	}
?>
<script language="javascript" src="<?php echo $this->lists['comdir']; ?>shop_category.js"></script>
<script language="javascript" type="text/javascript">
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
		
		/*if (form.catid.value == 0)
		{
			alert('<?php echo JText::_( 'Please select a category' ); ?>');
			return;
		}*/

		// do field validation
		submitform( pressbutton );
	}
</script>
<form action="<?php echo $this->action; ?>" method="post" name="adminForm" id="adminForm">
<div class="col width-70">
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'Details' ); ?></legend>
  <table class="admintable">
    <tr>
      <td width="100" align="right" class="key"><label for="<?php echo $this->prefix; ?>name"> <?php echo JText::_( strtoupper('Name') ); ?>: </label>
      </td>
      <td><input class="text_area" type="text" name="<?php echo $this->prefix; ?>name" id="<?php echo $this->prefix; ?>name" size="32" maxlength="250" value="<?php echo $this->shop_category->name;?>" />
      </td>
    </tr>
	
	<tr>
      <td valign="top" align="right" class="key"><?php echo JText::_( strtoupper('Published') ); ?>: </td>
      <td><?php echo $this->lists['published']; ?> </td>
    </tr>

	<tr>
      <td valign="top" align="right" class="key"><label for="<?php echo $this->prefix; ?>short_description"> <?php echo JText::_( strtoupper('Short_description') ); ?>: </label>
      </td>
      <td><?php
							// parameters : areaname, content, width, height, cols, rows, show xtd buttons
							echo $this->editor->display( $this->prefix.'short_description',  $this->shop_category->short_description, '600', '200', '60', '20', array('pagebreak', 'readmore') ) ;
							?>
      </td>
    </tr>

	<tr>
      <td valign="top" align="right" class="key"><label for="<?php echo $this->prefix; ?>description"> <?php echo JText::_( strtoupper('Description') ); ?>: </label>
      </td>
      <td><?php
							// parameters : areaname, content, width, height, cols, rows, show xtd buttons
							echo $this->editor->display( $this->prefix.'description',  $this->shop_category->description, '600', '400', '60', '20', array('pagebreak', 'readmore') ) ;
							?>
      </td>
    </tr>
	<tr>
      <td valign="top" align="right" class="key"><label for="ordering"> <?php echo JText::_( strtoupper('Ordering') ); ?>: </label>
      </td>
      <td><?php echo $this->lists['ordering']; ?> </td>
    </tr>
  </table>
</fieldset>
</div>
<div class="col width-30">
	<?php
			echo $this->pane->startPane("params-pane");
			$title = JText::_( strtoupper('Parameters') );
			echo $this->pane->startPanel( $title, "detail-page" );
		?>
		<table class="admintable">

	<tr>
      <td width="100" align="right" class="key"><label for="<?php echo $this->prefix; ?>parent"> <?php echo JText::_( strtoupper('Parent') ); ?>: </label>
      </td>
      <td>
	  <?php echo $this->lists['parent']; ?>
      </td>
    </tr>
		
	<tr>
      <td valign="top" align="right" class="key"><label for="<?php echo $this->prefix; ?>created"> <?php echo JText::_( strtoupper('Created') ); ?>: </label>
      </td>
      <td colspan="2" valign="middle"><?php echo JHTML::_('calendar', $this->lists['created'], $this->prefix.'created', $this->prefix.'created', "%Y-%m-%d %H:%M:%S", array('class'=>'inputbox', 'size'=>'32',  'maxlength'=>'45')); ?> </td>
    </tr>

	<tr>
      <td valign="top" align="right" class="key"><label for="<?php echo $this->prefix; ?>modified"> <?php echo JText::_( strtoupper('Modified') ); ?>: </label>
      </td>
      <td colspan="2" valign="middle"><?php echo JHTML::_('calendar', $this->lists['modified'], $this->prefix.'modified', $this->prefix.'modified', "%Y-%m-%d %H:%M:%S", array('class'=>'inputbox', 'size'=>'32',  'maxlength'=>'45')); ?> </td>
    </tr>
	
		</table>
	<?php
			echo $this->pane->endPanel();
			$title = JText::_( strtoupper('Parameters (Advanced)') );
			echo $this->pane->startPanel( $title, "detail-page" );
			echo $this->params->render('params');
			echo $this->pane->endPanel();
			$title = JText::_( strtoupper('Gallery') );
			echo $this->pane->startPanel( $title, "detail-page" );
		?>
		<table class="admintable">

	<tr>
      <td valign="middle" align="right" class="key"><label for="<?php echo $this->prefix; ?>filename"> <?php echo JText::_( strtoupper('Filename') ); ?>: </label><br />
	  (<a class="modal-button" rel="{handler: 'iframe', size: {x: 570, y: 400}}" href="index.php?option=com_rokquickcart&amp;view=images&amp;tmpl=component&amp;e_name=<?php echo $this->prefix; ?>filename">Click here to upload</a>)
      </td>
      <td valign="middle">
		
		<input class="inputbox" type="hidden" name="<?php echo $this->prefix; ?>filename" id="<?php echo $this->prefix; ?>filename" readonly="true" size="50" maxlength="255" value="<?php echo $this->shop_category->filename; ?>" onchange="javascript:
						if (document.forms.adminForm.<?php echo $this->prefix; ?>filename.value!='') {
							document.<?php echo $this->prefix; ?>filename_src.src='../'+document.forms.adminForm.<?php echo $this->prefix; ?>filename.value;
						} 
						else {
							document.<?php echo $this->prefix; ?>filename_src.src='../images/blank.png';
						}" />
		
        <a href="<?php echo $this->lists['filename_src']; ?>" title="Image" class="modal-button">
		<img name="<?php echo $this->prefix; ?>filename_src" id="<?php echo $this->prefix; ?>filename_src" src="<?php echo $this->lists['filename_src']; ?>" width="100" /></a>
			
			 </td>
    </tr>

	<tr>
      <td width="100" align="right" class="key"><label for="<?php echo $this->prefix; ?>thumbnail"> <?php echo JText::_( strtoupper('Thumbnail') ); ?>: </label><br />
	  (<a class="modal-button" rel="{handler: 'iframe', size: {x: 570, y: 400}}" href="index.php?option=com_rokquickcart&amp;view=images&amp;tmpl=component&amp;e_name=<?php echo $this->prefix; ?>thumbnail">Click here to upload</a>)
      </td>
      <td><input class="text_area" type="hidden" name="<?php echo $this->prefix; ?>thumbnail" id="<?php echo $this->prefix; ?>thumbnail" size="32" maxlength="250" value="<?php echo $this->shop_category->thumbnail;?>" onchange="javascript:
						if (document.forms.adminForm.<?php echo $this->prefix; ?>thumbnail.value!='') {
							document.<?php echo $this->prefix; ?>thumbnail_src.src='../'+document.forms.adminForm.<?php echo $this->prefix; ?>thumbnail.value;
						} 
						else {
							document.<?php echo $this->prefix; ?>thumbnail_src.src='../images/blank.png';
						}" />
						
				<a href="<?php echo $this->lists['thumbnail_src']; ?>" title="Image" class="modal-button">
		<img name="<?php echo $this->prefix; ?>thumbnail_src" id="<?php echo $this->prefix; ?>thumbnail_src" src="<?php echo $this->lists['thumbnail_src']; ?>" width="100" /></a>
      </td>
    </tr> 

		</table>
	<?php
				echo $this->pane->endPanel();
				echo $this->pane->endPane();
		?>	
</div>   
  <div class="clr"></div>
  <input type="hidden" name="option" value="com_shop_category" />
  <input type="hidden" name="cid[]" value="<?php echo $this->shop_category->mwc_shop_category_id; ?>" />
  <input type="hidden" name="task" value="" />
  <?php echo JHTML::_( 'form.token' ); ?>
</form>
